package com.huawei123.hasee.cniao5store.mvp.presenter.impl;

import com.huawei123.hasee.cniao5store.api.IGetDataDelegate;
import com.huawei123.hasee.cniao5store.base.BaseActivity;
import com.huawei123.hasee.cniao5store.base.mvp_base.MvpPresenterImpl;
import com.huawei123.hasee.cniao5store.bean.CategoryBean;
import com.huawei123.hasee.cniao5store.mvp.interactor.CategoryInteractor;
import com.huawei123.hasee.cniao5store.mvp.presenter.CategoryFragmentPresenter;
import com.huawei123.hasee.cniao5store.mvp.view.view.CategoryFragmentView;

import javax.inject.Inject;

/**
 * 项目名称：Cniao5Store
 * 类描述：分类加载处理
 * 创建人：luohao
 * 创建时间：2018/1/29 23:52
 * 修改人：luohao
 * 修改时间：2018/1/29 23:52
 * 修改备注：
 */

public class CategoryPresenterImpl extends MvpPresenterImpl<CategoryFragmentView> implements CategoryFragmentPresenter {
    @Inject
    CategoryInteractor categoryInteractor;

    @Inject
    public CategoryPresenterImpl() {
    }

    @Override
    public void getCategpryFragmentData(BaseActivity activity) {
        categoryInteractor.loadCategoryData(activity, new IGetDataDelegate<CategoryBean>() {
            @Override
            public void getDataSuccess(CategoryBean categoryBean) {
                myPresenterView.requestDataSuccess(categoryBean);
            }

            @Override
            public void getDataError(String errmsg) {
                myPresenterView.requestDataError(errmsg);
            }
        });
    }
}
